<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<title><?php print $head_title ?></title>
		<?php
			$rt_utils_includes = path_to_theme() . "/rt_utils.php";
			include $rt_utils_includes;
			$style_switcher = path_to_theme() . "/rt_styleswitcher.php";
			include $style_switcher;
		?>
		<?php print $head; ?>
		<?php print $styles; ?>		
		<?php print $scripts; ?>
		
		<?php
			$head_includes = path_to_theme() . "/rt_head_includes.php";
			include $head_includes;
		?>	
		
		<?php
			if (isset($_GET['tstyle']) ) {
				$change = "tstyle";
				$styleVar = $_GET['tstyle'];
				
				quasar_change_theme($change, $styleVar);
			}
			
			
			if (isset($_GET['reset-settings']) ) {
				quasar_restore_defaults();
			}
		?>
		
		<link href="<?php echo base_path() . path_to_theme(); ?>/css/general.css" rel="stylesheet" type="text/css" />

		<?php 
			global $user;
            $thisMenuType = $quasar_menutype;
        ?>

</head>
	<body class="backgroundlevel-<?php print $quasar_background_level; ?> bodylevel-<?php print $quasar_body_level; ?> cssstyle-<?php print $quasar_css_style; ?> font-family-<?php print $quasar_font_family; ?> font-size-is-<?php print $quasar_default_font ?> col12 ">
	
		<?php /** Begin Top **/ if ($top) : ?>
		<div id="rt-top">
			<div class="rt-container">
				<div id="rt-top2">
					<?php echo $top; ?>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<?php /** End Top **/ endif; ?>
		
		<div id="rt-header">
			<div class="rt-container">
				<div id="rt-header2">
					<div id="rt-header3">
						<div id="rt-header4">
							<div class="rt-grid-4 rt-alpha">
								<div class="rt-block">
									<a href="<?php echo check_url($front_page); ?>" id="rt-logo" class="png"></a>
								</div>
							</div>
							<div class="rt-grid-8 rt-omega">
								<?php /** Begin Menu **/ if($quasar_menutype != "none") : ?>
								
									<div class="_menu">
										<div class="rt-block">
											<div class="module-surround">
												<div class="module-content">
												
												</div>
											</div>
											
										</div>
										
								    	<div class="clear"></div>
									
									</div>
									
								
								<?php /** End Menu **/ endif; ?>
							</div>
							
							<div class="clear"></div>
							<?php /** Begin Header **/ if ($header) : ?>
							
								<?php echo $header; ?>
								
							<?php /** End Header **/ endif; ?>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<?php /** Begin Showcase **/ if ($showcase) : ?>
		<div id="rt-showcase">
			<div class="rt-container">
				<?php echo $showcase; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Showcase **/ endif; ?>
		<?php /** Begin Feature **/ if ($feature) : ?>
		<div id="rt-feature">
			<div class="rt-container">
				<?php echo $feature; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Feature **/ endif; ?>
		<?php /** Begin Top Tab **/ if (theme_get_setting(top_tab_content) != "" ) : ?>
		<div id="rt-toptab">
			<div class="rt-container">
				<div class="rt-block">
					<div class="shadow">
						<div class="toptab">
							<span class="toptab2">
								<?php echo theme_get_setting(top_tab_content); ?>
							</span>
						</div>
					</div>
				</div>
				
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Top Tab **/ endif; ?>
		<?php /** Begin Main Body **/ ?>
		<div id="rt-main-surround">
			<?php /** Begin Main Top **/ if ($maintop) : ?>
			<div id="rt-maintop">
				<div class="rt-container">
					<?php echo $maintop; ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Main Top **/ endif; ?>
			<?php /** Begin Breadcrumbs **/ if (theme_get_setting(show_breadcrumb)) : ?>
			<div id="rt-breadcrumbs">
				<div class="rt-container">
					<?php print $breadcrumb; ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Breadcrumbs **/ endif; ?>
			
			
			<?php /** Begin Main Body Columns **/ ?>
		    	
		    	<?php 
		    
		    		$sidebar_count = 0;
		    		if($sidebar) {$sidebar_count++;}
		    		if($sidebar2) {$sidebar_count++;}
		    	
		    		
		    		if($sidebar_count == 0) {
		    			$gridClass = "mb12-sb0";
		    			$maingrid = "12";
		    		}
		    		elseif($sidebar_count==1) {
		    			$mbGrid = getMBgrid(1);
		    			$mbNumber = $mbGrid[3];
		    			$maingrid = $mbGrid[0];
		    			$sidegrid = $mbGrid[1];
		    			if($mbNumber >= 3) {
		    				$gridClass = "sa".$sidegrid."-sb"."-mb".$maingrid;
		    			}
		    			else {
		    				$gridClass = "mb".$maingrid."-sa".$sidegrid;
		    			}
		    		}	
		    		elseif($sidebar_count==2) {
		    			$mbGrid = getMBgrid(2);
		    			$mbNumber = $mbGrid[3];
		    			$maingrid = $mbGrid[0];
		    			$sidegrid = $mbGrid[1];
		    			$sidegrid2 = $mbGrid[2];
		    			if($mbNumber >= 2) {
		    				$gridClass = "sa".$sidegrid."-sb".$sidegrid2."-mb".$maingrid;
		    			}
		    			else {
		    				$gridClass = "mb".$maingrid."-sa".$sidegrid."-sb".$sidegrid2;
		    			}
		    		}
		    		
		    	    
		    	?>			
		    	
		    		<div id="rt-main" class="<?php echo $gridClass; ?>">
		    			
		    	    	<div class="rt-container">
		    	    		
		    	    		<?php if($sidebar AND (($sidebar_count==1 AND $mbNumber >= 3) OR ($sidebar_count==2 AND $mbNumber >= 2) )): ?>
		    	    			<div class="rt-grid-<?php print $sidegrid;?>">
		    						<div id="rt-sidebar-a">
		    							<?php print $sidebar; ?>
		    						</div>
		    					</div>
		    					<div class="rt-grid-<?php print $sidegrid2;?>">
		    						<div id="rt-sidebar-b">
		    							<?php print $sidebar2; ?>
		    						</div>
		    					</div>
		    	    		<?php endif; ?>
		    	    		
		    	    		<div class="rt-grid-<?php print $maingrid;?>">
		    	            	
		    	            	<?php if($contenttop): ?>
		    	            	<div id="rt-content-top">
		    	            		<?php print $contenttop; ?>
		    	            		<div class="clear"></div>
		    	            	</div>
		    	            	<?php endif; ?>
		    	            	
		    	            	<div class="rt-block">
		    	               		
		    							<div class="rt-mainbody">
		    								
    										<div class="rt-joomla">
    											<!-- Begin Admin Tabs -->
    											<?php if ($tabs): print '<ul class="primary png">' . $tabs .'</ul>'; print "<br>"; endif; ?>
    											<?php if ($tabs2): print '<ul class="secondary">' . $tabs2 .'</ul>'; print "<br>"; endif; ?>
    										  	<!-- End Admin Tabs -->
    										  	
    										  	<?php if ($messages AND !$is_front): ?>
    												<?php print $messages; ?><br />
    											<?php endif; ?>
    											
    											<!-- Print Section Heading -->
    											<h2><?php print $title ?></h2>
    											
    											
    	                                        <?php print $content; ?>
    	                                       
    	                                    </div>
			    	                                
		    								  	
		    							</div>
		    						
		    					</div>
		    					<?php if($contentbottom): ?>
		    	            	<div id="rt-content-bottom">
		    	            		<?php print $contentbottom; ?>
		    	            		<div class="clear"></div>
		    	            	</div>
		    	            	<?php endif; ?>
		    					<!-- content bottom here -->
		    				</div>
		    				
		    				<?php if($sidebar_count AND (($sidebar_count==1 AND $mbNumber < 3) OR ($sidebar_count==2 AND $mbNumber < 2) )): ?>
		    			
		    	    			<?php if($sidebar2): ?>
		    	        			<div class="rt-grid-<?php print $sidegrid2;?>">
		    							<div id="rt-sidebar-b">
		    								<?php print $sidebar2; ?>
		    							</div>
		    						</div>
		    					<?php endif; ?>
		    	    			<div class="rt-grid-<?php print $sidegrid;?>">
		    						<div id="rt-sidebar-a">
		    							<?php print $sidebar; ?>
		    						</div>
		    					</div>
		    					
		    	    		<?php endif; ?>
		    				
		    			
		    		</div>	
		    		<div class="clear"></div>
		    </div>
		    
			<?php /** End Main Body Columns **/ ?>
			
			
			<?php /** Begin Main Bottom **/ if ($mainbottom) : ?>
			<div id="rt-mainbottom">
				<div class="rt-container">
					<?php echo $mainbottom; ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Main Bottom **/ endif; ?>
		</div>
		<div class="clear"></div>
		<?php /** End Main Body **/ ?>
		<?php /** Begin Bottom Tab **/ if (theme_get_setting(bottom_tab_content) != "" and $bottom) : ?>
		<div id="rt-bottomtab">
			<div class="rt-container">
				<div class="rt-block">
					<div class="bottomtab">
						<span class="bottomtab2">
							<?php echo theme_get_setting(bottom_tab_content); ?>
						</span>
					</div>
				</div>
				
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Bottom Tab **/ endif; ?>
		<?php /** Begin Bottom **/ if ($bottom) : ?>
		<div id="rt-bottom">
			<div class="rt-container">
				<?php echo $bottom; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Bottom **/ endif; ?>
		<?php /** Begin Footer **/ if ($footer) : ?>
		<div id="rt-footer">
			<div class="rt-container">
				<?php echo $footer; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Footer **/ endif; ?>
		<?php /** Begin Copyright **/ if ($copyright) : ?>
		<div id="rt-copyright">
			<div class="rt-container">
				<?php echo $copyright; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Copyright **/ endif; ?>
		<?php /** Begin Debug **/ if ($debug) : ?>
		<div id="rt-debug">
			<div class="rt-container">
				<?php echo $debug; ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Debug **/ endif; ?>
		<?php print $closure;?>
	</body>
</html>
